<style>
  .picImg {
    width: 40px;
    height: 40px;
  }
</style>
<template>
  <div class="app-container">
    <!--&lt;!&ndash; 查询和其他操作 &ndash;&gt;-->
    <!-- 查询结果 -->
    <el-table v-loading="listLoading" :data="list" element-loading-text="正在查询中。。。" border fit highlight-current-row
              :header-cell-style="{background:'#B3D8FD'}">

      <el-table-column fixed align="center" min-width="100" label="关联类型" prop="type">
        <template slot-scope="scope">
          <span>{{ scope.row.type ? '权益服务商' : '保代公司'}}</span>
        </template>
      </el-table-column>
      <el-table-column align="center" min-width="100" label="保险公司名称" prop="insuranceID"/>
      <el-table-column align="center" min-width="100" label="保代公司名称" prop="agentID"/>
      <el-table-column align="center" min-width="100" label="保理公司名称" prop="factoringID"/>
      <el-table-column align="center" min-width="100" label="垫资额度(万元)" prop="amount"/>
      <el-table-column align="center" min-width="100" label="垫资总日息(‱)" prop="interestAll"/>
      <el-table-column align="center" min-width="110" label="保理公司日息(‱)" prop="interestFactoring"/>
      <el-table-column align="center" min-width="200" label="服务费账户号" prop="serviceAccount"/>
      <el-table-column align="center" min-width="200" label="共管账户号" prop="account"/>
      <el-table-column align="center" min-width="200" label="共管账户名称" prop="accName"/>
      <el-table-column align="center" min-width="100" label="共管账户银行代码" prop="bankCode"/>
      <el-table-column align="center" min-width="200" label="共管账户联行号" prop="interBankNo"/>
      <el-table-column align="center" min-width="110" label="是否代付中转" prop="isRepay">
        <template slot-scope="scope">
          <span>{{ scope.row.isRepay ? '代付' : '不代付'}}</span>
        </template>
      </el-table-column>
      <el-table-column align="center" min-width="200" label="代付账号" prop="repayAccount"/>
      <el-table-column align="center" min-width="170" label="创建时间" prop="timeAdd"/>
    </el-table>
    <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
                @pagination="getList"/>
  </div>
</template>

<script>
  import {doGet, doPost} from '@/api'
  import {cities} from '@/utils/base'
  import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
  import checkPermission from '@/utils/permission' // 权限判断函数

  export default {
    name: 'correlation',
    components: {Pagination},
    filters: {
      // accTyped: function(val){
      //     return function (val){
      //         return {0: "服务费账户",1: "代付账户"}[val] || "未知"
      //     }
      // },
    },
    data() {
      return {
        list: [],
        total: 0,
        listLoading: true,
        listQuery: {
          page: 1,
          limit: 20,
        }
      }
    },
    created() {
      this.getList()
    },
    methods: {
      checkPermission,

      // 获取三方关联列表
      getList() {
        this.listLoading = true
        doGet('correlation.html?op=list', this.listQuery).then(response => {
          this.list = response.rows
          this.total = response.rows.length
          this.listLoading = false
        }).catch(() => {
          this.list = []
          this.total = 0
          this.listLoading = false
        })
      }
    }
  }
</script>
